<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>已选项目</title>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
		<link rel="stylesheet" href="../css/leftSidebar.css">
	</head>
	<style type="text/css">
        html,body{padding-bottom: 50px;}
		.col-xs-12.nav_right{padding: 0;height: 100px;padding-right: 0;margin-right: 0;min-width: 1100px;height: 100px;padding-right: 0;margin-right: 0;padding-left: 160px;}
		#myTab a{color: #7c7c7c;font-family: "微软雅黑";font-size: 15px;}
		#myTab>li.active>a{color: #3f4142; background-color: #fff;}
		.navbar-form{margin-top: 0;}
		.tab_creat .active{color:#6bc50d;}
		.table>tbody>tr.active>td, .table>tbody>tr.active>th, .table>tbody>tr>td.active, .table>tbody>tr>th.active, .table>tfoot>tr.active>td, .table>tfoot>tr.active>th, .table>tfoot>tr>td.active, .table>tfoot>tr>th.active, .table>thead>tr.active>td, .table>thead>tr.active>th, .table>thead>tr>td.active, .table>thead>tr>th.active{background-color: #fff;}
		.table>tfoot>tr.active>td{background-color: #fff;}
		.table>tbody>tr>td{border-top:0;}
		.table{margin-bottom: 0;}
		div.tab_creat.row{background-color: #fff;}
		.tab_font{padding: 10px 0;}
		.tab_font div,.tab_font td{font-size: 14px;color: #919191;}
		.gongsi_list div.col-xs-2,.gongsi_list div.col-xs-3,.gongsi_list div.col-xs-1{text-align: center;padding: 20px 0;}
		.gongsi_list.row{background-color: #fff;margin-top: 20px;}
		.gongsi_list dd div.col-xs-2{font-size: 14px;color: #4f5051;}
		.row{margin: 0;}
		.sub_logo{position: relative;display: inline-block;padding-left: 0;}
		.sub_logo input{opacity: 0;position: absolute;left: 0;right: 0;bottom: 0;top: 0;}
		.zhube_head{border-bottom: 1px solid #ddd;}
		.zhube_head h3{padding: 5px 0;,font-family: "微软雅黑";color: #222c38;font-size: 16px;border-bottom: 4px solid #5a626d;}
			
		#form_test label{font-size: 14px;font-family: "微软雅黑";color: #515151;font-weight: normal;}
		#form_test  .media-middle{font-size: 14px;color: #acacac;}
		.form_tip{font-size: 12px;color: #acacac;font-family: "微软雅黑";}
		.btn-default{border-color: #6bc50d;color: #6bc50d;}
		.btn-default.disabled{background-color: #ccc;color: #fff;border-color:#ccc;}
		.btn-default.disabled.focus, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled].focus, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover{background-color: #ccc;color: #fff;}
		
		.panel-title{font-size: 18px;color: #222c38;font-weight: bold;}
		
		.gongsi_list div.col-xs-2,.gongsi_list div.col-xs-1,.gongsi_list div.col-xs-4{text-align: center;padding: 20px 0;}
		.gongsi_list.row{background-color: #fff;margin-top: 20px;}
		.gongsi_list dd div.col-xs-2{font-size: 14px;color: #4f5051;}


	</style>
	<body style="background-color: #f2f2f2;">
		<div class="row warp" style="height: 100%;">
			<div class="nav_right_head">
				<a href="../index.html"><img src="../img/roleIndexBg.jpg"/></a>
			</div>
			<!--左侧导航-->
			<div class="col-xs-2 nav_left">
				<div class="creatNav">导师服务</div>
				<div class="creatLoginStatus"><img src="../img/avtar.png"><a>您好，导师</a></div>
				<div class="list-group" style="padding: 0;">
					<a href="daoshi_index.html" class="list-group-item "><i class="glyphicon glyphicon-home"></i> 首页</a>
					<!--<a href="daoshirenzheng_1.html" class="list-group-item"><i class="glyphicon glyphicon-education"></i> 导师认证</a>-->
					<a href="daoshi_yxxm.html" class="list-group-item active"><i class="glyphicon glyphicon-folder-open"></i> 已选项目</a>
					<a href="daoshi_gzxm.html" class="list-group-item"><i class="glyphicon glyphicon-question-sign"></i> 关注项目</a>
					<a href="daoshi_mynews.html" class="list-group-item" ><i class="glyphicon glyphicon-book"></i>  我的消息</a>
					<a href="daoshi_lingyudongtai.html" class="list-group-item"><i class="glyphicon glyphicon-send"></i> 领域动态</a>
				</div>
				<div class="backBtn"> <a href="../index.html"><img src="../img/backIndex.png"></a></div>
			</div>

		</div>
			
			<div class="col-xs-12 nav_right" style="">

	
				<div class="row" style="margin-top: 10px;">
					<div class="col-xs-10 col-xs-offset-1" >
						<div class="panel panel-default">
							<div class="panel-heading">
								<h3 class="panel-title">已选项目</h3>
							</div>
							<div class="panel-body" style="padding: 0;">
								<div class="row gongsi_list">
									<dl style="background-color: #fff;">
										<dt>
										<div class="row">
											<div class="col-xs-2">项目名称</div>
											<div class="col-xs-2">项目编号</div>
											<div class="col-xs-2">融资阶段</div>
											<div class="col-xs-2">创业领域</div>
											<div class="col-xs-2">项目更新</div>
											<div class="col-xs-2">导师批阅</div>


										</div>
										</dt>
										<div>
											<div id="company_list">

											</div>
											<ul class="pagination pull-right" id="page">

											</ul>
										</div>
										<!--<dd>-->
										<!--<div class="row">-->
										<!--<div class="col-xs-4" style="padding-top: 10px;">-->
										<!--<div class="media">-->
										<!--<div class="media-left media-middle" style="padding: 0px 15px;">-->
										<!--<img src="../img/23.jpg" style="width: 40px;height: 40px;"/>-->
										<!--</div>-->
										<!--<div class="media-body text-left">-->
										<!--<span style="display: inline-block;margin-top: 10px;"><a href="cyzfw_myProgress_xq.html">aicar</a></span>-->
										<!---->
										<!--</div>-->
										<!--</div>-->
										<!--</div>-->
										<!---->
										<!--<div class="col-xs-2">移动wifi</div>-->
										<!--<div class="col-xs-2">生活消费</div>-->
										<!---->
										<!--<div class="col-xs-2">暂未透露</div>-->
										<!---->
										<!--<div class="col-xs-2"><span>关注</span>  </div>			-->
										<!--</div>-->
										<!---->
										<!--</dd>-->




									</dl>

								</div>
							</div>
						</div>
					</div>


					<div class="col-xs-10 col-xs-offset-1">
						<div class="panel panel-default">
					  <div class="panel-heading">
					    <h3 class="panel-title " id="progress">相关项目</h3>
					  </div>
					  <div class="panel-body" style="padding: 0;">
					    <div class="row gongsi_list">
							<dl style="background-color: #fff;">
										<dt>
											<div class="row">
												<div class="col-xs-4" style="text-align: left;padding-left: 15px;">创业公司</div>
												<div class="col-xs-2">融资阶段</div>
												<div class="col-xs-2">创业领域</div>
												<div class="col-xs-1">导师</div>
												<div class="col-xs-2">过往投资方</div>
												<div class="col-xs-1">操作</div>
												
											</div>
										</dt>
										<dd>
											<div class="row">
												<div class="col-xs-4" style="padding-top: 10px;">
													<div class="media">
													  <div class="media-left media-middle" style="padding: 0px 15px;">
													     <img src="../img/11.jpg" style="width: 40px;height: 40px;"/>
													  </div>
													  <div class="media-body text-left">
													     <span style="display: inline-block;margin-top: 10px;"><a href="cyzfw_myProgress_xq.html">无人机</a></span>
												
													  </div>
													</div>
													</div>
									
												<div class="col-xs-2">201703024</div>
												<div class="col-xs-2">生活消费</div>
												<div class="col-xs-1">陈希东</div>
												<div class="col-xs-2">无</div>
												<div class="col-xs-1">关注</div>
												
											
											</div>
										
										</dd>
											<dd>
											<div class="row">
												<div class="col-xs-4" style="padding-top: 10px;">
													<div class="media">
													  <div class="media-left media-middle" style="padding: 0px 15px;">
													     <img src="../img/12.jpg" style="width: 40px;height: 40px;"/>
													  </div>
													  <div class="media-body text-left">
													     <span style="display: inline-block;margin-top: 10px;"><a href="cyzfw_myProgress_xq.html">智能机器人</a></span>
												
													  </div>
													</div>
													</div>

												<div class="col-xs-2">201703024</div>
												<div class="col-xs-2">生活消费</div>
												<div class="col-xs-1">陈希东</div>
												<div class="col-xs-2">无</div>
												<div class="col-xs-1">关注</div>
												
											
											</div>
										
										</dd>
											<dd>
											<div class="row">
												<div class="col-xs-4" style="padding-top: 10px;">
													<div class="media">
													  <div class="media-left media-middle" style="padding: 0px 15px;">
													     <img src="../img/13.jpg" style="width: 40px;height: 40px;"/>
													  </div>
													  <div class="media-body text-left">
													     <span style="display: inline-block;margin-top: 10px;"><a href="cyzfw_myProgress_xq.html">智能手表</a></span>
												
													  </div>
													</div>
													</div>

												<div class="col-xs-2">201703024</div>
												<div class="col-xs-2">生活消费</div>
												<div class="col-xs-1">陈希东</div>
												<div class="col-xs-2">无</div>
												<div class="col-xs-1">关注</div>
												
											
											</div>
										
										</dd>
									</dl>

						</div>
					  </div>
					</div>
					
					</div>
				</div>
					
		</div>
		
	</body>
	<script src="../js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../js/bootstrap-paginator.min.js"></script>
	<script type="text/javascript" src="../js/public.js"></script>
	<script type="text/javascript">
		var person = JSON.parse(sessionStorage.getItem("person"));
		if (person==''||person==null) {
//			alert('请先登录')
//			 window.location.href='denglu.html';
		} else{
			var userId = person.userid;
			console.log(userId);

		}



		getpbList({'userId':userId},1,10,"http://114.112.96.184:18080/tutor/myPbs",'#company_list');
		//项目列表
		function getpbList(objs,page,pageSize,apiUrl,select){
			objs.index=page;
			objs.size=pageSize;
			$.ajax({
				type: "get",
				data:objs,
				url:apiUrl,
				async: false,
				error: function(request) {
					console.log("Connection error");
				},
				success: function(data) {
					console.log(data)
					var pages=Math.ceil(data.result.totalElements/10);

					if(pages<=1){
						$("#page").hide();
					}else{
						$("#page").show();
					}
					var options={
						bootstrapMajorVersion:3,
						currentPage:page,    //当前页数
						numberOfPages:10,
						totalPages:pages,    //所有数据可以显示的页数
						tooltipTitles:function(){
						},
						itemTexts: function (type, page, current) {
							switch (type) {
								case "prev": return "←上一页";
								case "next": return "下一页→";
								case "page": return page;
							}
						},
						shouldShowPage:function(type, page, current){
							switch(type)
							{
								case "first":
								case "last":
									return false;
								default:
									return true;
							}
						},
						onPageClicked:function(event, originalEvent, type,page){
							console.log(page)
							console.log(objs)
							objs.index=page;
							$.ajax({
								type: "get",
								data: objs,
								url: apiUrl,
								async: false,
								error: function (request) {
									console.log("Connection error");
								}, success: function (data) {

									var obj = data.result.content;
									var htmls='';
									for (var i = 0; i < obj.length;i++) {
										var createTime =obj[i].createTime.substring(0,10)
										var attention='';
										var pbName = '';
										pbName=obj[i].pbName;
										if (pbName.length>4){
											pbName=pbName.substring(0,4) + '...'
										}
										if (obj[i].attention==true) {
											attention='取消关注';
										} else{
											attention='关注';
										}
										if(obj[i].userId==userId){
											attention='我的项目';
										}
										htmls+= '<dd>'+
												'<div class="row">'+
												'<div class="col-xs-2" style="padding-top:3px ;"><img src="'+obj[i].logo +'"  onerror="onErrorHandle(this)" style="width: 40px;height: 40px;" /> <a href="cyzfw_myProgress_xq_totur.html?'+obj[i].id +'" pbId="'+ obj[i].id+'" title="'+obj[i].pbName+'">'+ pbName+'</a></div>'+
												'<div class="col-xs-2" title="'+obj[i].no+'">'+no +'</div>'+
												'<div class="col-xs-2">'+ obj[i].stage+ '</div>'+
												'<div class="col-xs-2">'+obj[i].field+'</div>'+
												'<div class="col-xs-2">'+ "暂无"+'</div>'+
												'<div class="col-xs-2">'+ "暂无"+'</div>'+
												'</div>'+
												'</dd>'
									}
									$(select).html(htmls);

								}
							});

						}
					}
					if(data.result.totalElements>0){
						$("#page").bootstrapPaginator(options);
					}
					var obj = data.result.content;
					var htmls='';
					for (var i = 0; i < obj.length;i++) {
						var createTime =obj[i].createTime.substring(0,10)
						var attention='';
						var pbName = '';
						pbName=obj[i].pbName;
						if (pbName.length>4){
							pbName=pbName.substring(0,4) + '...'
						}
						if(obj[i].userId==userId){
							attention='我的项目';
						}
						var stage  = obj[i].stage;
						if(!stage){
							stage="暂未透露"
						}
						var no = obj[i].no.substring(0,10)+'...';
						htmls+= '<dd>'+
								'<div class="row">'+
								'<div class="col-xs-2" style="padding-top:3px ;"><img src="'+obj[i].logo +'"  onerror="onErrorHandle(this)" style="width: 40px;height: 40px;" /> <a href="cyzfw_myProgress_xq_totur.html?'+obj[i].id +'" pbId="'+ obj[i].id+'" title="'+obj[i].pbName+'">'+ pbName+'</a></div>'+
								'<div class="col-xs-2" title="'+obj[i].no+'">'+no +'</div>'+
								'<div class="col-xs-2">'+ obj[i].stage+ '</div>'+
								'<div class="col-xs-2">'+obj[i].field+'</div>'+
								'<div class="col-xs-2">'+ "暂无"+'</div>'+
								'<div class="col-xs-2">'+ "暂无"+'</div>'+
								'</div>'+
								'</dd>'
					}
					$(select).html(htmls);

				}
			});
		}

		//放弃辅导
		$(document).on('click','.attentionPb',function () {
			if (person==''||person==null) {
				window.location.href='denglu.html';
				return;
			}
			var id = $(this).attr('attentionId');
			var that = $(this);
			attentionPb();
			function attentionPb() {
				$.ajax({
					type: "post",
					data:{'userId':userId},
					url:"http://114.112.96.184:18080/tutor/pb/"+id,
					async: false,
					error: function(request) {
						console.log("Connection error");
					},
					success: function(data) {
						console.log(data);
						if(data.code='000'){
							that.parent().parent().remove();
						}else {
							alert(data.msg)
						}

					}
				});
			}

		});

		//图片加载失败情况
		function onErrorHandle(obj){
			obj.src="../img/defaultAvatar.png";
		}
	</script>

</html>
